﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using blackhouse.BlackApart.Business.Cities;
using blackhouse.BlackApart.Web;
using blackhouse.BlackApart.Web.Navigation;

namespace blackhouse.Aparts.Web.Modules {
    public class QucikReservationLink : HyperLink {

        protected override void OnLoad(EventArgs e) {
            base.OnLoad(e);

            DateTime arrivalDate = DateTime.Now;
            if (arrivalDate.Hour >= 14)
                arrivalDate += TimeSpan.FromDays(1);

            DateTime departureDate = arrivalDate + TimeSpan.FromDays(1);
            SearchState state = SearchState.GetState(arrivalDate, departureDate, 1);

            this.NavigateUrl = NavigationProvider.Instance().GetUrl(state);
        }

    }
}